import React, { Component } from 'react';
import { View, Text, ScrollView, StyleSheet, TouchableOpacity, Image, TextInput } from 'react-native';
import { MapView, Marker } from 'react-native-amap3d';
import { List, TextareaItem, ImagePicker, Button, InputItem, Checkbox } from '@ant-design/react-native';
const Item = List.Item;
const Brief = Item.Brief;
const AgreeItem = Checkbox.AgreeItem;
const CheckboxItem = Checkbox.CheckboxItem;
const data = [{
    url: 'https://zos.alipayobjects.com/rmsportal/PZUUCKTRIHWiZSY.jpeg',
    id: '2121',
}, {
    url: 'https://zos.alipayobjects.com/rmsportal/hqQWgTXdrlmVVYi.jpeg',
    id: '2122',
}];
export default class Home_table extends Component {

    static navigationOptions = props => {

        return {
            headerTitle: `检查表填写          `,
            headerTintColor: "#fff",
            headerTitleStyle: {
                flex: 1,
                textAlign: 'center',
                fontSize: 16
            },
            headerStyle: {
                backgroundColor: "#6E75FF",
            }
        }
    };

    state = {
        startD: 0,
        endD: 0,
        wrap: false,
        files: data,
        multiple: false,
        number: 0
    }

    ondw = (nativeEvent) => {
        console.log(`${nativeEvent.latitude}, ${nativeEvent.longitude}`)
    }

    onqiandao = () => {
        console.log(4567896)
    }

    onChange = (files, type, index) => {
        console.log(files, type, index);
        this.setState({
            files,
        });
    }
    onSegChange = (e) => {
        const index = e.nativeEvent.selectedSegmentIndex;
        this.setState({
            multiple: index === 1,
        });
    }

    onsubmit = () => {
        this.props.navigation.navigate('HomeScreen')
    }

    render() {
        const { files } = this.state;

        return (
            <View style={{
                flexDirection: "row",
                flex: 1,
                backgroundColor: "#FFF2F2F2"
                 }}>
                <ScrollView style={{ flex: 1, }}>
                    <View style={{ flex: 1, height: 50, backgroundColor: "#fff", marginTop: 2, marginBottom: 5 }}>
                        <Text style={{ textAlign: "center", lineHeight: 50, color: "#000", fontSize: 16 }}>瓶装气供应站(点)安全检查考核评分表</Text>
                    </View>

                    <View style={{ flexDirection: "row", display: "flex", height: 50, backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1 }}>
                            <Text style={{ textAlign: "left", lineHeight: 50, paddingLeft: 15 }}>被检供应站名称 : </Text>
                        </View>
                        <View style={{ flex: 1 }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                            />
                        </View>
                    </View>

                    <View style={{ flexDirection: "row", display: "flex", height: 50, backgroundColor: "#fff" }}>
                        <View style={{ flex: 1 }}>
                            <Text style={{ textAlign: "left", lineHeight: 50, paddingLeft: 15 }}>被检查人 : </Text>
                        </View>
                        <View style={{ flex: 1 }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                            />
                        </View>
                    </View>

                    <View style={{ flexDirection: "row", display: "flex", height: 50, }}>
                        <View style={{ flex: 2 }}>
                            <Text style={{ textAlign: "center", lineHeight: 50, paddingLeft: 15 }}>考核内以标准</Text>
                        </View>
                        <View style={{ flex: 1 }}>
                            <Text style={{ textAlign: "center", lineHeight: 50, paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1 }}>
                            <Text style={{ textAlign: "center", lineHeight: 50, paddingLeft: 15 }}>得分</Text>
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>营业期间瓶库无人员值守,扣10分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>当班人员未持有安全员证,扣10分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>门面外观不符合统一形象要求或严重
                破损,扣5分；无警示标识,扣3分；地
                面禁火线不清晰,扣5分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{padding:5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>瓶库无分区标识,扣2分；钢瓶未分区
码放,扣3分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>瓶库的室内地面防火花胶皮未铺满或
有破损,扣5分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{padding:5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>瓶装气供应站未配备检斤检漏工具,
扣5分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>营业室未悬挂服务制服、应急救援现
场处置方案,扣5分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>营业室作为生活居住房间,扣5分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>


                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>无日常安全检查记录,扣5分；记录不
完整,扣5分；记录台账未使用计算机
管理,扣2分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>无气瓶销售记录, 扣10分；记录不完
整,扣5分；记录台账未使用计算机管
理,扣2分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>无商业用户送气上门安全检查记录,扣
10分；记录不全,扣5分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ padding:5,flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>营业人员、送气工未着企业工作服,扣
5分；中心城区未使用统一送气车辆,
扣5分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 2, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>总分</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingLeft: 15 }}>分值</Text>
                        </View>
                        <View style={{ flex: 1, justifyContent: 'center', }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                                style={{ textAlign: "center" }}
                            />
                        </View>
                    </View>

                    <View style={{ flexDirection: "row", display: "flex", height: 50, }}>
                        <View style={{ flex: 1 }}>
                            <Text style={{ textAlign: "center", lineHeight: 50, paddingLeft: 15 }}>否决项</Text>
                        </View>
                        <View style={{ flex: 3 }}>
                            <Text style={{ textAlign: "center", lineHeight: 50, paddingRight: 15 }}>以下问题存在一项则整表得分为0分</Text>
                        </View>

                    </View>

                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>《武汉市燃气供气场站许可证》超期</Text>
                        </View>
                    </View>



                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>瓶库与明火或散发的火花的地点间距小于
10米</Text>
                        </View>
                    </View>

                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>三级站瓶库实瓶存量按15kg钢瓶折算超过
30瓶</Text>
                        </View>
                    </View>

                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>销售非自有、超期、未粘贴充装合格证钢
瓶的(实瓶2瓶以上)</Text>
                        </View>
                    </View>

                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>瓶库内使用非防爆电器，电线套管不符合
要求</Text>
                        </View>
                    </View>

                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>配备8kg的干粉灭火器少于2具，或不在有
效期内</Text>
                        </View>
                    </View>

                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>无一年一次燃气报警器 、排风扇联动检测
合格报告</Text>
                        </View>
                    </View>

                    <View style={{ padding: 5, flexDirection: "row", display: "flex", backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1, justifyContent: 'center', alignItems: "center" }}>
                            <Checkbox
                                checked={this.state.checkBox1}
                                style={{ color: '#f00' }}
                                onChange={event => {
                                    this.setState({ checkBox1: event.target.checked });
                                }}
                            />
                        </View>

                        <View style={{ flex: 3, justifyContent: 'center', }}>
                            <Text style={{ textAlign: "center", paddingRight: 15 }}>未安装远传泄漏报警装置的(中心城区)</Text>
                        </View>
                    </View>

                    <View style={{ flexDirection: "row", display: "flex", height: 50, backgroundColor: "#fff", borderBottomWidth: 1, borderBottomColor: "#ccc" }}>
                        <View style={{ flex: 1 }}>
                            <Text style={{ textAlign: "left", lineHeight: 50, paddingLeft: 15 }}>检查考核人 : </Text>
                        </View>
                        <View style={{ flex: 1 }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                            />
                        </View>
                    </View>

                    <View style={{ flexDirection: "row", display: "flex", height: 50, backgroundColor: "#fff" }}>
                        <View style={{ flex: 1 }}>
                            <Text style={{ textAlign: "left", lineHeight: 50, paddingLeft: 15 }}>检查考核时间 : </Text>
                        </View>
                        <View style={{ flex: 1 }}>
                            <TextInput
                                onChangeText={(text) => this.setState({ text })}
                                value={this.state.text}
                            />
                        </View>
                    </View>

                    <View style={{ flex: 1, backgroundColor: "#fff" }}>
                    <View>
                        <List>
                            <Item>
                                任务备注
                        </Item>
                        </List>
                    </View>
                    <View style={{ flex: 1 }}>
                        <TextareaItem rows={4} placeholder="最多输入100个字" count={100} />
                        <ImagePicker
                            files={files}
                            onChange={this.onChange}
                            onImageClick={(index, fs) => console.log(index, fs)}
                            selectable={files.length < 7}
                            multiple={this.state.multiple}
                        />
                        
                    </View>
                    </View>
                    <Button style={{backgroundColor:"#6E75FF",marginTop:20}} type="primary" onPress={this.onsubmit}>提交</Button>






                </ScrollView>
            </View>
        )
    }
}